package com.ulrica.morning.dto.tcmsp;

import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;
import java.math.RoundingMode;

/**
 * 药品成分信息
 *
 * @author LongKui
 * @since 2022/06/28
 */
@Data
public class Ingredients {
    /**
     * Mol ID
     */
    private String MOL_ID;
    /**
     * Molecule Name
     */
    private String molecule_name;
    /**
     * MW
     */
    private String mw;
    /**
     * AlogP
     */
    private String alogp;
    /**
     * Hdon
     */
    private String hdon;
    /**
     * Hacc
     */
    private String hacc;
    /**
     * OB (%)
     * 需要>= 30 (%)
     */
    private String ob;
    /**
     * Caco-2
     */
    private String caco2;
    /**
     * BBB
     */
    private String bbb;
    /***
     * DL
     * 需要>= 0.18
     */
    private String dl;
    /**
     * FASA-
     */
    private String FASA;
    /**
     * HL
     */
    private String halflife;

    @Override
    public String toString() {

        return MOL_ID + "\t" +
                molecule_name + "\t" +
                (StringUtils.isBlank(mw) ? "" : new BigDecimal(mw).setScale(2, RoundingMode.HALF_UP)) + "\t" +
                (StringUtils.isBlank(alogp) ? "" : new BigDecimal(alogp).setScale(2, RoundingMode.HALF_UP)) + "\t" +
                hdon + "\t" +
                hacc + "\t" +
                (StringUtils.isBlank(ob) ? "" : new BigDecimal(ob).setScale(2, RoundingMode.HALF_UP)) + "\t" +
                (StringUtils.isBlank(caco2) ? "" : new BigDecimal(caco2).setScale(2, RoundingMode.HALF_UP)) + "\t" +
                (StringUtils.isBlank(bbb) ? "" : new BigDecimal(bbb).setScale(2, RoundingMode.HALF_UP)) + "\t" +
                (StringUtils.isBlank(dl) ? "" : new BigDecimal(dl).setScale(2, RoundingMode.HALF_UP)) + "\t" +
                (StringUtils.isBlank(FASA) ? "" : new BigDecimal(FASA).setScale(2, RoundingMode.HALF_UP)) + "\t" +
                (StringUtils.isBlank(halflife) ? "" : new BigDecimal(halflife).setScale(2, RoundingMode.HALF_UP));
    }
}
